package com.yonyou.pmclouds.procedure.rmiitf;

import com.yonyou.pmclouds.basecom.exception.BusinessException;
import com.yonyou.pmclouds.procedure.entity.ProcedureRefVO;
import com.yonyou.pmclouds.procedure.entity.ProcedureVO;

import java.util.List;
import java.util.Map;

public interface ProcedureQuery {
    /**
     * 查询租户底下的所有工序，不构造成树
     * <br>保护性限制2000条，有特殊情况再说
     */
    ProcedureVO[] queryProcedureByTenant(String tenantid, byte enableStatus) throws BusinessException;

    ProcedureRefVO[] queryProcedureRefByTenant(String tenantid) throws BusinessException;

    ProcedureVO getById(String id) throws BusinessException;

    /**
     * 为工序的参照性质的批量查询、提供的接口
     * <br>
     * 该接口强制限制查询数量，以期避免一些错误Pro
     *
     * @see com.yonyou.pmclouds.basecom.util.CommonProgramConsts#DEFAULT_MAX_QUERY_SIZE
     */
    Map<String, ProcedureRefVO> queryRefs(String[] ids) throws BusinessException;////

    /**
     * 根据根节点主键，查询复合条件的工序节点
     */
    ProcedureVO[] queryProcedureByRoots(String[] pkRoots) throws BusinessException;

    Map<String, String> queryNameByIds(String[] ids) throws BusinessException;

    ProcedureRefVO[] queryRefByProject(String pkPro,String tenantId) throws BusinessException;

    Map<String, List<ProcedureRefVO>> queryRefByProjectIds(String[] pkProjects, String tenantId) throws BusinessException;
}
